package com.wn55.hrms.mapper;

import com.wn55.hrms.entity.Evection;
import com.wn55.hrms.entity.OverTime;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface EvectionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Evection record);

    Evection selectByPrimaryKey(Integer id);

    List<Evection> selectAll();

    int updateByPrimaryKey(Evection record);

    List<Evection> selectConds(@Param("eName") String eName, @Param("type") String type);


    @Insert(value= "insert into evection (e_id, e_name, type, start_time,end_time, isdelete) " +
            "values(#{eId},#{eName},#{type},#{startTime},#{endTime},0)")
    @Options(useGeneratedKeys = true,keyProperty ="id",keyColumn = "id")
    void insertEvection(Evection evection);

    int selectEvectionByMonth(@Param("salaryMonth") String salaryMonth,@Param("id") Long id);
}